package com.dfqy.util;


import org.mindrot.jbcrypt.BCrypt;

public class PasswordUtil {
    // 生成密码的哈希值
    public static String hashPassword(String password) {
        String hashedPassword = BCrypt.hashpw(password, BCrypt.gensalt());
        return hashedPassword;
    }

    // 验证密码是否匹配
    public static boolean verifyPassword(String password, String hashedPassword) {
        return BCrypt.checkpw(password, hashedPassword);
    }

}
